package com.tang.service.impl;

import com.tang.entity.User;
import com.tang.mapper.UserMapper;
import com.tang.service.UserService;
import com.tang.utils.MyBatisUtils;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/**
 * @Author TangBowen
 * @create 2021/6/7 13:03
 */
public class UserServiceImpl implements UserService {
    @Override
    public List<User> login(User user) {
        SqlSession session = MyBatisUtils.getSqlSession();
        UserMapper userMapper = session.getMapper(UserMapper.class);
        List<User> users = userMapper.login(user);
        session.close();
        return users;
    }
}
